﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace WooCoo.Authorization
{
    /// <summary>
    /// 资源成员权限。
    /// 成员定义：资源下的成员对象，例如数据库字段
    /// </summary>
    public class MemberRight : ICloneable
    {
        /// <summary>
        /// 字段名
        /// </summary>
        public string MemberName { get; set; }
        /// <summary>
        /// 是否只读
        /// </summary>
        public bool IsReadOnly { get; set; }
        /// <summary>
        /// 是否可为空
        /// </summary>
        public bool IsUnnullable { get; set; }
        /// <summary>
        /// 是否不可见
        /// </summary>
        public bool IsUnvisible { get; set; }
        /// <summary>
        /// 查询条件
        /// </summary>
        public string SelectCondition { get; set; }


        #region ICloneable 成员

        public object Clone()
        {
            MemberRight clone = new MemberRight();
            clone.MemberName = this.MemberName;
            clone.IsReadOnly = this.IsReadOnly;
            clone.IsUnnullable = this.IsUnnullable;
            clone.IsUnvisible = this.IsUnvisible;
            clone.SelectCondition = this.SelectCondition;
            return clone;
        }

        #endregion
    }
}
